var saleP = echarts.init(document.getElementById("saleP-echarts"));
saleP_option = {
    series: [
        {

            type: 'pie',
            radius: '55%',

            data: [
                {value: 274, name: '生活用品区'},
                {value: 235, name: '食品区'},
                {value: 310, name: '酒水区'},
                {value: 335, name: '饮料区'},
                {value: 400, name: '零食区'},
                {value: 320, name: "水果区"},
                {value: 209, name: "其它"}
            ]
        }
    ]
};

// 使用刚指定的配置项和数据显示图表。
saleP.setOption(saleP_option);
var echartsA = echarts.init(document.getElementById('tpl-echarts'));
echartsA_option = {
    tooltip: {
        trigger: 'axis'
    },
    grid: {
        top: '3%',
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: [{
        type: 'category',
        boundaryGap: false,
        data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
    }],
    yAxis: [{
        type: 'value'
    }],
    textStyle: {
        color: '#838FA1'
    },
    series: [{
        name: '销售额',
        type: 'line',
        stack: '总量',
        areaStyle: {normal: {}},
        data: [12000, 13200, 10001, 10304, 9000, 20500, 23000],
        itemStyle: {
            normal: {
                color: '#1cabdb',
                borderColor: '#1cabdb',
                borderWidth: '2',
                borderType: 'solid',
                opacity: '1'
            },
            emphasis: {}
        }
    }]
};

echartsA.setOption(echartsA_option);
window.addEventListener("resize", function () {
    saleP.resize();
    echartsA.resize();
});